// with polyfills
import 'core-js/stable'
import 'regenerator-runtime/runtime'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store/'
import i18n from './locales'
import { VueAxios } from './utils/request'
import ProLayout, { PageHeaderWrapper } from '@ant-design-vue/pro-layout'
import themePluginConfig from '../config/themePluginConfig'
import infiniteScroll from 'vue-infinite-scroll'
import KFormDesign from './components/k-form-design/packages'
import './components/k-form-design/styles/form-design.less'

// mock
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
// import './mock'
import bootstrap from './core/bootstrap'
import './core/lazy_use'
import './permission' // permission control
import './utils/filter' // global filter
import './global.less'
import './style/base.less'
import './style/antd.css' // 调整antd组件样式（字号大小、字体颜色）
import './style/css/style.css'
import './assets/iconfont/iconfont.js' // 阿里图标
import IconPower from '@/components/Power/Iconfont/IconPower' // 阿里图标自定义组件
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'

// ant-d 组件库
import Antd from 'ant-design-vue/es'
import 'ant-design-vue/dist/antd.css'

// 全局css样式表
import './assets/css/base/flex.scss'
import './assets/css/base/other.scss'
// import './assets/css/base/button.scss'
import './assets/css/apply/title.scss'
import './assets/css/base/layout.scss'
import './assets/css/apply/list_operation.scss'

Vue.config.productionTip = false
Vue.prototype.$env = process.env
// mount axios to `Vue.$http` and `this.$http`
Vue.use(VueAxios)
Vue.use(infiniteScroll)
Vue.use(KFormDesign)
Vue.use(Viewer)
Vue.component('pro-layout', ProLayout)
Vue.component('page-header-wrapper', PageHeaderWrapper)
Vue.component('icon-power', IconPower)
Vue.use(Antd)

window.umi_plugin_ant_themeVar = themePluginConfig.theme

// 引入事件总线
Vue.prototype.$EventBus = new Vue()

// 生产环节禁用控制台日志
if (['production'].includes(process.env.NODE_ENV)) {
  window.console.log = () => { }
}

new Vue({
  router,
  store,
  i18n,
  created: bootstrap,
  render: h => h(App)
}).$mount('#app')
